import Vue from "vue";
import VueRouter from "vue-router";

import Layout from "@/layout";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Layout,
    redirect: "myComponents",
    children: [
      {
        path: "demo",
        name: "demo",
        component: () => import("@/views/demo/index"),
      },

      {
        path: "myComponents",
        name: "myComponents",
        component: () => import("@/views/myComponents/index"),
      },
      {
        path: "todoList",
        name: "todoList",
        component: () => import("@/views/todoList/index"),
      },
      {
        path: "jumpBall",
        name: "jumpBall",
        component: () => import("@/views/jumpBall/index"),
      },
    ],
  },
];

const router = new VueRouter({
  // mode: "history",
  // base: process.env.BASE_API,
  routes,
});

export default router;
